home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / MacTools / TC Prog Guide / app ƒ / menu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-13  |  872 b   |  40 lines  |  [TEXT/KAHL]

  1. /*
  2. *    FILE:        menu.h
  3. *    AUTHOR:        R. Gonzalez
  4. *    CREATED:    August 25, 1990
  5. *
  6. *    Defines menu class for Generic_App.
  7. */
  8.  
  9. # ifndef    menu_h
  10. # define    menu_h
  11.  
  12. # include    "class.h"
  13. # include    "app.h"
  14.  
  15. # define    MAX_MENUS    20
  16. # define    MAX_ITEMS    20
  17. # define    ILLEGAL        -1
  18.  
  19. /* pointer to function used to implement a command: */
  20. typedef    boolean (*comfunc)(Generic_App*);
  21.  
  22. /************************************************************************
  23. *    menu
  24. ************************************************************************/
  25. struct    Menu:Generic_Class
  26. {
  27.     int                num_menus;
  28.     int                num_items[MAX_MENUS+1];
  29.     char            *command[MAX_MENUS+1][MAX_ITEMS+1];
  30.     comfunc            command_ptr[MAX_MENUS+1][MAX_ITEMS+1];
  31.     
  32.     boolean            init(void);
  33.     virtual    boolean    log_command(int,int,char*,comfunc);
  34.     virtual int        get_menu(char*);
  35.     virtual int        get_item(char*);
  36.     virtual comfunc    get_command_ptr(int,int);
  37. };
  38.  
  39. # endif
  40.